package cn.com.dhc.danlu.model;

import java.io.Serializable;

public class AccountPaymentType implements Serializable {
    private static final long serialVersionUID = -1034059231958362326L;
    /**
     * 卖家数量
     */
    private int sellerCount = 0;
    /**
     * 支持货到付款数量
     */
    private int supportCodCount = 0;
    /**
     * 支持在线支付数量
     */
    private int onLinePaymentCount = 0;

    public AccountPaymentType (int sellerCount) {
        this.sellerCount = sellerCount;
    }

    public int getSupportCodCount () {
        return supportCodCount;
    }

    public void setSupportCodCount (int supportCodCount) {
        this.supportCodCount = supportCodCount;
    }

    public int getOnLinePaymentCount () {
        return onLinePaymentCount;
    }

    public void setOnLinePaymentCount (int onLinePaymentCount) {
        this.onLinePaymentCount = onLinePaymentCount;
    }

    public void ini () {
        supportCodCount = 0;
        onLinePaymentCount = 0;
    }

    /**
     * 货到付款数量增加
     */
    public void addSupportCodCount (int count) {
        supportCodCount += count;
    }

    /**
     * 在线支付数量增加
     */
    public void addOnLinePaymentCount (int count) {
        onLinePaymentCount += count;
    }

    /**
     * 是否全部卖家支持货到付款
     */
    public boolean isSupportCodForAllSeller () {
        return sellerCount > 0 && sellerCount == supportCodCount;
    }

    /**
     * 是否全部卖家支持在线支付
     */
    public boolean isOnlinePayForAllSeller () {
        return sellerCount > 0 && sellerCount == onLinePaymentCount;
    }
}